package senders;

import java.awt.Shape;
import java.util.ArrayList;

import org.jhotdraw.draw.Figure;

import util.FigureWrapper;

import child.ChildServer;
import client.remote.ClientReceiver;

public class ChildBroadcaster implements IBroadcaster 
{
	ChildServer parentServer;
	ChatBroadCaster chatBroadcaster;
	FigureBroadCaster figureBroadcaster;
	public ChildBroadcaster(ChildServer childServer)
	{
		chatBroadcaster = new  ChatBroadCaster(this,false);
		figureBroadcaster = new FigureBroadCaster(this);
		parentServer = childServer;
	}
	@Override
	public synchronized ArrayList<ClientReceiver> getClients() {
		return parentServer.getClients();
	}
	public void shutdown()
	{
		chatBroadcaster.shutdown();
		figureBroadcaster.shutdown();
	}
	@Override
	public void bcMessage(String msg) 
	{
		chatBroadcaster.addMessage(msg);
	}
	public void bcFigure(Shape figure)
	{
		figureBroadcaster.addFigure(figure);
	}
	@Override
	public void reportError(ClientReceiver client)
	{
		parentServer.reportError(client);
		
	}
	

}
